// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import YDUI from 'vue-ydui';
import 'vue-ydui/dist/ydui.rem.css';
import { Slider} from 'element-ui';
import 'vue-ydui/dist/ydui.flexible.js';
import axios from 'axios'
Vue.prototype.$http = axios;
import store from './vuex/store'
import { mapGetters, mapActions, mapState} from 'vuex'

Vue.use(YDUI);
Vue.use(Slider);
Vue.config.productionTip = false
router.beforeEach((to, from, next) => {
	/* 路由发生变化修改页面title */
	if(to.meta.title) {
		document.title = to.meta.title
	}
	next()
})

import AMap from 'vue-amap'
Vue.use(AMap)
AMap.initAMapApiLoader({
	key: '5746ea8a5591bae6b13448967136e467',
	plugin: ['AMap.Geolocation', 'AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor']
})

new Vue({
	el: '#app',
	router,
	store,
	components: {
		App
	},
	template: '<App/>'
})